home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mikecom / xoffclr.asm < prev    next >
Assembly Source File  |  1987-05-19  |  1KB  |  40 lines

  1.  
  2. title MANUALLY CLEAR RX'D XOFF CONDITION
  3. include subfx.h
  4.  
  5. ;  Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503
  6.  
  7. IMPORT_NEAR     <__tx_inton>
  8.  
  9. ;****************************************************************************
  10. ; ASYNC_XOFFCLR -- Clears XOFF received condition manually and re-enables
  11. ;  transmitting of characters.  If the remote's rx buffer is actually getting
  12. ;  full this may result in a buffer overflow on that end or another XOFF
  13. ;  may be sent by the remote in which case transmission will stop again.
  14. ;****************************************************************************
  15. begseg          COMM_TEXT
  16. publicproc      _async_xoffclr
  17.         push    bp
  18.         mov     bp,sp
  19.         push    si              ;stack frame setup
  20.         call    __ck_port_arg   ;ck if valid, load pointers
  21.         jz      xoffclr_exit    ;bad arg if ZR flag set
  22.         mov     ax,R_BADARG
  23.         test    STAT2,B_XUSE
  24.         jz      xoffclr_exit    ;bad arg if not using XOFF protocol
  25.         cli
  26.         and     TX_STAT,n B_XRXD  ;clr XOFF rcvd bit
  27.         jnz     xoffclr_ex1     ;done if some other reason not to transmit
  28.         call    __tx_inton      ;else restart transmitter
  29. xoffclr_ex1:
  30.         sti
  31.         xor     ax,ax           ;returning R_OK
  32. xoffclr_exit:
  33.         pop     si
  34.         pop     bp
  35.         ret                     ;restore regs and exit
  36. _async_xoffclr  endp
  37.  
  38. endseg          COMM_TEXT
  39.         end
  40.